//
//  BBLoginViewController.m
//  BearSiX
//
//  Created by 潘宇 on 16/3/25.
//  Copyright © 2016年 Tom. All rights reserved.
//

#import "BBLoginViewController.h"
#import "BBFunctionViewController.h"
#import "BBSelfViewController.h"
#import "BBTabViewController.h"
@interface BBLoginViewController ()

@end

@implementation BBLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIImageView *Loginimg=[[UIImageView alloc]initWithFrame:CGRectMake(WINSIZEWIDTH/2-45, 60, 90, 90)];
    NSLog(@"%f",WINSIZEHEIGHT);
    [Loginimg setImage:[UIImage imageNamed:@"login_1"]];
    
     [self.view addSubview:Loginimg];
    UILabel *titleLab=[[UILabel alloc]initWithFrame:CGRectMake(WINSIZEWIDTH/2-95, 170, 250, 14)];
    titleLab.text=@"北京施华洛婚纱摄影广渠门店";
    titleLab.font = [UIFont fontWithName:@"Helvetica" size:15.f];
    titleLab.textColor=[UIColor colorWithHexString:@"4d4d4d"];
    [self.view addSubview:titleLab];
    UIImageView *phoneimg=[[UIImageView alloc]initWithFrame:CGRectMake(35, 220, 25, 25)];
    [phoneimg setImage:[UIImage imageNamed:@"login_2"]];
    [self.view addSubview:phoneimg];
    UITextField *phonetfd=[[UITextField alloc]initWithFrame:CGRectMake(70, 220, WINSIZEWIDTH/2+10, 30)];
    if (WINSIZEWIDTH==320) {
        phonetfd.font = [UIFont fontWithName:@"Helvetica" size:13.f];
    }
    else if (WINSIZEWIDTH==414){
        phonetfd.font = [UIFont fontWithName:@"Helvetica" size:17.f];
    }
    phonetfd.keyboardType=UIKeyboardTypeNumberPad;
    phonetfd.placeholder=@"请输入你的编码/手机号";
    [self.view addSubview:phonetfd];
    UIButton *downbtn=[[UIButton alloc]initWithFrame:CGRectMake(WINSIZEWIDTH/2+100, 230, 17, 10)];
    if (WINSIZEWIDTH==375) {
        downbtn.frame=CGRectMake(WINSIZEWIDTH/2+130, 230, 17, 10);
    }
    else if (WINSIZEWIDTH==414){
        downbtn.frame=CGRectMake(WINSIZEWIDTH/2+130, 230, 17, 10);
    }
    [downbtn setBackgroundImage:[UIImage imageNamed:@"login_3"] forState:UIControlStateNormal];
    //1233211234567
    [downbtn addTarget:self action:@selector(tabhidden) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:downbtn];
    
    UIView *lineview=[[UIView alloc]initWithFrame:CGRectMake(50, 260, WINSIZEWIDTH-100, 1)];
    lineview.backgroundColor=[UIColor colorWithHexString:@"f6f6f6"];
    [self.view addSubview:lineview];
    
    UIImageView *passwordimg=[[UIImageView alloc]initWithFrame:CGRectMake(36, 280, 23, 25)];
    [passwordimg setImage:[UIImage imageNamed:@"login_4"]];
    [self.view addSubview:passwordimg];
    UITextField *passwordtfd=[[UITextField alloc]initWithFrame:CGRectMake(70, 280, WINSIZEWIDTH/2+10, 30)];
    if (WINSIZEWIDTH==320) {
        passwordtfd.font = [UIFont fontWithName:@"Helvetica" size:13.f];
    }
    else if (WINSIZEWIDTH==414){
        passwordtfd.font = [UIFont fontWithName:@"Helvetica" size:17.f];
    }
    passwordtfd.placeholder=@"请输入你的密码";
    passwordtfd.secureTextEntry=YES;
    [self.view addSubview:passwordtfd];
    
    UIView *lineview2=[[UIView alloc]initWithFrame:CGRectMake(50, 320, WINSIZEWIDTH-100, 1)];
    lineview2.backgroundColor=[UIColor colorWithHexString:@"f6f6f6"];
    [self.view addSubview:lineview2];
    UIButton *loginbtn=[[UIButton alloc]initWithFrame:CGRectMake(30, 360, WINSIZEWIDTH-60, 40)];
    [loginbtn setBackgroundColor:[UIColor colorWithHexString:@"fd004d"]];
    [loginbtn setTitle:@"登录" forState:UIControlStateNormal];
    [loginbtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    //设置cornerRadius
                                
    loginbtn.layer.cornerRadius = 5.0;
    loginbtn.adjustsImageWhenHighlighted=YES;
  
    loginbtn.highlighted=[UIColor grayColor];
    [self.view addSubview:loginbtn];
    
    UIButton *qsnbtn=[[UIButton alloc]initWithFrame:CGRectMake(WINSIZEWIDTH/2-50  , 410, WINSIZEWIDTH/2-60, 20)];
    if (WINSIZEWIDTH==414) {
        qsnbtn.frame=CGRectMake(WINSIZEWIDTH/2-70, 410, WINSIZEWIDTH/2-60, 20);
    }
    else if (WINSIZEWIDTH==375){
        qsnbtn.frame=CGRectMake(WINSIZEWIDTH/2-60, 410, WINSIZEWIDTH/2-60, 20);
    }
    [qsnbtn setBackgroundColor:[UIColor whiteColor]];
    [qsnbtn setTitle:@"登录遇见问题?" forState:UIControlStateNormal];
    qsnbtn.titleLabel.font=[UIFont fontWithName:@"Helvetica" size:13.f];
    [qsnbtn setTitleColor:[UIColor colorWithHexString:@"fd004d"] forState:UIControlStateNormal];
    [self.view addSubview:qsnbtn];
    
    UILabel *phoneLab=[[UILabel alloc]initWithFrame:CGRectMake(WINSIZEWIDTH/2-95, WINSIZEHEIGHT-70, 250, 20)];
    if (WINSIZEWIDTH==414) {
        phoneLab.frame=CGRectMake(WINSIZEWIDTH/2-100, WINSIZEHEIGHT-70, 250, 20);
    }
    else if (WINSIZEHEIGHT==480){
        phoneLab.frame=CGRectMake(WINSIZEWIDTH/2-100, WINSIZEHEIGHT-30, 250, 20);
    }
    phoneLab.text=@"熊宝贝电话热线：400 100 7592";
    phoneLab.font = [UIFont fontWithName:@"Helvetica" size:15.f];
    phoneLab.textColor=[UIColor grayColor];
    [self.view addSubview:phoneLab];
    UITableView *loginphone=[[UITableView alloc]initWithFrame:CGRectMake(70, 260, WINSIZEWIDTH-150, 90) style:UITableViewStylePlain];
    loginphone.backgroundColor=[UIColor redColor];
    loginphone.hidden=YES;
    [self.view addSubview:loginphone];
//    [loginbtn presentViewController:BBFunctionViewController animated:YES completion:nil];
    // Do any additional setup after loading the view.
    [loginbtn addTarget:self action:@selector(goToSet) forControlEvents:UIControlEventTouchUpInside];
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    
    [self.view endEditing:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)goToSet{
   
    [self presentViewController:[BBTabViewController TabSingleTon] animated:YES completion:nil];
}
-(void)tabhidden{
    
    
    
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
